package br.ucb.sigplan.action.impl;

import java.io.IOException;
import java.util.Locale;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.jsp.jstl.core.Config;

import br.ucb.sigplan.action.Action;

public class LinguaAction implements Action {

	@Override
	public String execute(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		
		Locale locale = new Locale(req.getParameter("lingua"));
		
		Config.set(req.getSession(), Config.FMT_LOCALE, locale);
		Config.set(req.getSession(), Config.FMT_FALLBACK_LOCALE, locale);
		
		resp.setLocale(locale);
		
		
		return "/login.jsp";
	}

}
